package org.example.bighomework.SC;
import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

//选课表和SC类对应
//使用联合主键
@Data
@Entity
@Table(name="sc")
@IdClass(SnoCnoPK.class)//联合主键（sno，cno）
public class SC{
    @Id
    @Column(name ="sno")
    private String sno;
    @Id
    @Column(name ="cno")
    private String cno;
    @Range(min = 0,max =100, message = "成绩应该为0~100或为空")
    private Integer grade;//验证数据合法性，必须为空或在0~100
}
